package cn.com.xyc.action;

import org.apache.struts2.ServletActionContext;

import cn.com.xyc.pojo.Admin;

import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String getBasePath() {
		return ServletActionContext.getRequest().getScheme() + "://"
				+ ServletActionContext.getRequest().getServerName() + ":"
				+ ServletActionContext.getRequest().getServerPort()
				+ ServletActionContext.getRequest().getContextPath();
	}

	public Admin getCurrentUser() {
//		Subject currentUser = SecurityUtils.getSubject();
//        return (Admin) currentUser.getPrincipal();
		Admin admin=new Admin();
		admin.setId("e754dfc0-ce1e-11e4-91ea-00163e003739");
		admin.setUsername("xyc312319");
		return admin;
	}

}
